package com;

public class Fibonacci {
	public static void FibonacciImpl(int n){
		int a = 0, b = 1;
		while(a < n){
			 int savePrev1 = a;
			 System.out.println(savePrev1);
			 a = b;
			 b = savePrev1+a;
		}
	}

	public static int fib(int n){
		if(n<2){
			return n;
		}else{
			return fib(n-1)+fib(n-2);
		}
	}
	
	public static void main(String[] args) {
		FibonacciImpl(10);
	   /* for (int i=0; i<=10; i++)
	        System.out.print(fib(i)+", ");*/
	}

}
